define([

        'text!app/tpl/recommedOrgList.html',
        "app/service/OrganizationService"
        ], function (
        recommedOrgListTpl,
        OrganizationService
    ) {

	var opt = {};

	return {

		directive_RecommendOrgListTab: function(){
			$("#tab2_nav").click(function(){

				if($(".tab2-content").find(".list-block").size() ==0){


					$.processing("刷新中...", 800,function(){

			            OrganizationService.initRecommendOrganizationList(function(resp){

			                console.log(resp);
							
			                var recommendOrgListUI = _.template(recommedOrgListTpl)({
			                    "orgList": resp.result,
			                    "unionid": $.getHashUrlParam("unionid")
			                });
			                $(".tab2-content").append(recommendOrgListUI);

			                $.hidePreloader();

			            });


					});


				}


			});
		},
		
		directive_createOrgButton: function(){

		}

		
	};

});
